package com.yiwei.hdb.activity;

import android.os.Bundle;
import android.text.Spanned;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yiwei.hdb.R;
import com.yiwei.hdb.event.FindXueXinSuccessEvent;
import com.yiwei.hdb.util.Spans;
import com.yiwei.hdb.view.FlowViewHorizontal;
import com.yiwei.hdb.view.V19FrameLayout;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2018/6/10.
 */

public class V3XueXinFindByEmailResetActivity extends BaseActivity {
    @BindView(R.id.btn_back)
    ImageView btnBack;
    @BindView(R.id.txt_title)
    TextView txtTitle;
    @BindView(R.id.layout_title)
    V19FrameLayout layoutTitle;
    @BindView(R.id.txt_tips1)
    TextView txtTips1;
    @BindView(R.id.txt_tips2)
    TextView txtTips2;
    @BindView(R.id.txt_forget)
    TextView txtForget;
    @BindView(R.id.txt_tips_three)
    TextView txtTipsThree;
    @BindView(R.id.btn_submit)
    TextView btnSubmit;
    @BindView(R.id.linearLayout)
    LinearLayout linearLayout;
    @BindView(R.id.step_view)
    FlowViewHorizontal stepView;
    private Unbinder unbinder;
    private int x30;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_xuexin_find_way_email_reset_v3);
        initBar();
        unbinder = ButterKnife.bind(this);
        init();
    }

    private void init() {
        String[] stepTitles = new String[]{"选择方式", "验证账户", "重置密码"};
        stepView.setProgress(3, 3, stepTitles, null);
        String email = getIntent().getStringExtra("email");
        x30=getResources().getDimensionPixelSize(R.dimen.x30);
        txtTips2.setText("系统已将重置密码的链接安全的发到了您的邮箱" + email + "，请及时查收。");
        Spanned forgetText = Spans.with(this).font("请登录您的邮箱，尝试到广告邮件、垃圾邮件目录里找找看，或点击 ", x30, 0xff616185).
                font("找回密码", x30, 0xff4C81FF).
                font("重试", x30, 0xff616185).
                build();
        txtForget.setText(forgetText);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unbinder.unbind();
        unbinder = null;
    }

    @OnClick({R.id.btn_back, R.id.txt_forget, R.id.txt_tips_three, R.id.btn_submit})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_back:
                finish();
                break;
            case R.id.txt_forget:
                finish();
                break;
            case R.id.txt_tips_three:

                break;
            case R.id.btn_submit:
                EventBus.getDefault().post(new FindXueXinSuccessEvent());
                finish();
                break;
        }
    }
}
